package com.csht.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.csht.mapper.CshtOneMenuMapper;
import com.csht.model.CshtOneMenu;
import com.csht.service.CshtOneMenuService;
import com.csht.vo.index.menu.CshtOneMenuVo;
import com.csht.vo.index.shangpinzhangqu.ShangPinZhangQu;

@Service
public class CshtOneMenuServiceImpl implements CshtOneMenuService {
	
	@Autowired
	private CshtOneMenuMapper cshtOneMenuMapper;

	/**
	 * 获取一、二、三级菜单（联表查询）
	 */
	@Override
	public List<CshtOneMenuVo> getOneOrTwoOrThreeMenu() throws Exception {
		List<CshtOneMenuVo> cshtOneMenuVoList = cshtOneMenuMapper.getOneOrTwoOrThreeMenu();
		return cshtOneMenuVoList;
	}

	/**
	 * 商品展区获取一级菜单
	 */
	@Override
	public List<ShangPinZhangQu> getOneOrTwoMenuAndBanner() throws Exception {
		List<ShangPinZhangQu> shangPinZhangQuList = cshtOneMenuMapper.getOneOrTwoMenuAndBanner();
		return shangPinZhangQuList;
	}

	/**
	 * 有用户登录时，商品展区获取一级菜单
	 */
	@Override
	public List<ShangPinZhangQu> getOneMenuAndBanner() throws Exception {
		List<ShangPinZhangQu> shangPinZhangQuList =  cshtOneMenuMapper.getOneMenuAndBanner();
		return shangPinZhangQuList;
	}

	/**
	 * (定位改变)商品展区获取一级菜单（封装二级菜单和banner图）
	 */
	@Override
	public List<ShangPinZhangQu> getOneMenu() throws Exception {
		List<ShangPinZhangQu> shangPinZhangQuList =  cshtOneMenuMapper.getOneMenu();
		return shangPinZhangQuList;
	}

	/**
	 * 查询全部一级菜单
	 */
	@Override
	public List<CshtOneMenu> getAllOneMenu() throws Exception {
		List<CshtOneMenu> cshtOneMenuList = cshtOneMenuMapper.getAllOneMenu();
		return cshtOneMenuList;
	}

}
